//
//  APILogger.swift
//  APIHeartRate
//
//  Created by fortresspower on 2023/12/3.
//

class APILogger {
    static let TAG = "APIHeartRateLogger"

    private var logger: APILoggerRepository = APILoggerDefaultImp()
    /**
     0 ff
     1 info
     2 debug
     */
    private var mLevel = 0

    func i(info: String) {
        if mLevel > 0 {
            logger.i(tag: APILogger.TAG, log: info)
        }
    }

    func d(info: String) {
        if mLevel > 1 {
            logger.d(tag: APILogger.TAG, log: info)
        }
    }

    func setLogger(impl: APILoggerRepository, level: Int) {
        logger = impl
        mLevel = level
    }

    func setLogLevel(level: Int) {
        mLevel = level
    }
}
